/**
 * 
 */
package com.ambow.entity;

import java.io.Serializable;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author Administrator
 * @param订单表
 */
@Entity
@Table
public class Orders extends ID implements Serializable {
	 private Date createTime;//创建时间
	 private  double totalPrice;//总价格
	 private int status;//0未支付，1已支付
	 @ManyToOne(targetEntity=User.class)
	 @JoinColumn(name="user_id",referencedColumnName="id")
	  private User user;
	 @ManyToOne(targetEntity=Product.class)
	 @JoinColumn(name="product_id",referencedColumnName="id")
	  private Product product;
	 @OneToMany(targetEntity=OrderDetail.class,mappedBy="order")
	   private Set<OrderDetail> orderDetails=new HashSet<OrderDetail>();
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	 
	 
	  

}
